﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace de.wolfmarco.pas.Shared.Helper
{
    public static class ComboBoxHelper
    {
        public static void SetItemsSource(ComboBox comboBox, Type itemsSource)
        {
            if (itemsSource.BaseType == typeof(Enum))
            {
                comboBox.ItemsSource = Enum.GetValues(itemsSource);
            }
            else
                throw new NotSupportedException("A Type of " + itemsSource + " is not supported!");
        }
    }
}
